#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include<QMainWindow>
#include<QPushButton>
#include<QTime>
#include<QPainter>
#include<QKeyEvent>
#include<QMessageBox>
#include"rule.h"
#include<QMediaPlayer>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
private:
    int **p;
public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    //初始化
    int c[4][4];
    QPushButton *button;
    int score=0;
    int bestScore;

    bool state;//判断状态

    void keyPressEvent(QKeyEvent *event);
    void paintEvent(QPaintEvent *);

    void Up();//界面上移
    void Down();//界面下移
    void Right();//界面右移
    void Left();//界面左移

    void myRand();
    void judgeStatus();

private slots:
    void slotstart();

    void on_rule_clicked();

    void on_quit_clicked();

    void on_Easy_clicked();

    void on_Difficult_clicked();

private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
